package com.qf.controller;

import com.qf.Movie;
import com.qf.service.HomepageService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("homepage")
@CrossOrigin
public class HomepageController {

    @Autowired
    private HomepageService homepageService;

    //热映
    @RequestMapping("now")
    public List<Movie> now(){
        List<Movie> now =homepageService.now();
        return now;
    }

    //即将上映
    @RequestMapping("pass")
    public List<Movie> pass(){
        List<Movie> pass =homepageService.pass();
        return pass;
    }

    //今日票房
    @RequestMapping("num")
    public List<Movie> num(){
        List<Movie> num =homepageService.num();
        return num;
    }
}
